home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / mikecom / txflush.asm < prev    next >
Assembly Source File  |  1987-06-04  |  1KB  |  46 lines

  1.  
  2. title FLUSH TRANSMIT BUFFER
  3. include subfx.h
  4.  
  5. ;  Mike Dumdei,  6 Holly Lane,  Texarkana TX  75503
  6.  
  7. IMPORT_NEAR     <__shutoff_tx>
  8. ifdef DBUG
  9. IMPORT_NEAR     <dsp_TXIN, dsp_TXOUT>
  10. endif
  11.  
  12. ;***************************************************************************
  13. ; ASYNC_TXFLUSH -- Clears the transmit buffer.
  14. ;***************************************************************************
  15. begseg          COMM_TEXT
  16. publicproc      _async_txflush
  17.         push    bp
  18.         mov     bp,sp
  19.         push    si              ;C stck frame, save regs
  20.         call    __ck_port_arg   ;ck for valid arg and load pointers
  21.         jz      txfl_exit       ;arg was bad if ZR set on rtrn
  22.         cli
  23.         mov     ax,TX_SIZE
  24.         mov     TX_FREE,ax      ;reset free space variable
  25.         mov     ax,TX_TOP
  26.         mov     TX_IN,ax
  27.         mov     TX_OUT,ax       ;reset tx buffer pointers
  28. ifdef DBUG
  29.         call    dsp_TXIN
  30.         call    dsp_TXOUT
  31. endif
  32.         cmp     TXIMMEDCHAR,0
  33.         jne     txfl_exit       ;jmp if still something to transmit
  34.         and     TX_STAT,n B_TXION  ;else clear bit saying tx'r is on
  35.         call    __shutoff_tx       ;and shut it off
  36. txfl_exit:
  37.         sti
  38.         pop     si
  39.         pop     bp
  40.         ret                     ;restore regs and exit
  41. _async_txflush  endp
  42.  
  43. endseg          COMM_TEXT
  44.         end
  45.  
  46.